#pragma once
#include "const.h"

class HttpConnection;
typedef  std::function<void(std::shared_ptr<HttpConnection>)> Httphandler;
typedef  std::function<bool(std::shared_ptr<HttpConnection>)> Http_Posthandler;
class LogicSys
{
public:
	~LogicSys();
	static LogicSys& getInst();
	bool HandleGet(std::string,std::shared_ptr<HttpConnection>);
	bool HandlePost(std::string, std::shared_ptr<HttpConnection>);
	void RegGet(std::string, Httphandler);
	void RegPost(std::string, Http_Posthandler);
private:
	std::map<std::string, Httphandler> _get_handlers;
	std::map<std::string, Http_Posthandler> _post_handlers;
	LogicSys();
	LogicSys(const LogicSys&) = delete;
	LogicSys& operator=(const LogicSys&) = delete;
};

